package com.dibang.app;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.amap.api.maps.TextureMapView;
import com.dibang.app.mvp.base.BaseActivity;
import com.dibang.app.mvp.util.ViewUtil;
import com.dibang.app.operation.control.abs.MainControl;
import com.dibang.app.operation.control.impl.MainControlImpl;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MainActivity extends BaseActivity<MainControl,MainControlImpl> {

    @BindView(R.id.mapview)
    TextureMapView mapView;


    @Override
    protected int onCreateBindViewLayoutId(@Nullable Bundle savedInstanceState) {
        return R.layout.activity_main;
    }

    @Override
    protected View onCreateBindViewUpdate(int layoutId, @Nullable Bundle savedInstanceState) {
        return ViewUtil.generateActivityViewContainTopView(this,layoutId,R.color.translucent_color);
    }

    @Override
    protected void onCreateBindViewChanged(@Nullable Bundle savedInstanceState) {
        ButterKnife.bind(this);
        mapView.onCreate(savedInstanceState);
        control.setMainViewExpandChanged();
    }


    @Override
    protected void onResume() {
        super.onResume();
        mapView.onResume();
    }


    @Override
    protected void onPause() {
        super.onPause();
        mapView.onPause();
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        mapView.onSaveInstanceState(outState);
    }


}
